<?php

require_once 'Demo/FlashMessengerTranslateDecorator.php';

class Demo_AdminActionBase extends SmartL_Zend_Controller_Action
{
	/**
	 * @var Demo_FlashMessenger
	 */
	protected $flashMessenger = null;
	
	public function init() {
		$this->flashMessenger = new Demo_FlashMessengerTranslateDecorator($this->_helper->getHelper('FlashMessenger'));
		$ds = DIRECTORY_SEPARATOR;		
		$filename = $this->application->getbasePath () . $ds . $this->application->getTranslationsDir () . $ds . 'CommonErrors.tmx';
		$translator = SmartL_Zend_Translate::createTranslate('tmx', $filename);
		$this->flashMessenger->setTranslator($translator);
		
		parent::init();
	}	
}